package main

import "fmt"

// Author : CSR丶WARRIOR
// Time ： 2020/10/13  14:34
// TOOLS : GoLand
// FILENAME : compareArray.go
// STATEMENT: 两个数组比较

func main() {
	var arr1 [5]int = [5]int{2, 3, 4, 5, 6}
	var arr2 [5]int = [5]int{2, 3, 9, 5, 6}
	/*res := compareValue(arr1, arr2)
	if res {
		fmt.Println("两数组一致")
	} else {
		fmt.Println("不一致")
	}
	//两数组一致*/
	fmt.Println(arr1 == arr2) //true
}

func compareValue(a [5]int, b [5]int) bool {
	var flag bool = true
	if len(a) == len(b) {
		for i := 0; i < len(a); i++ {
			if a[i] != b[i] {
				flag = false
				break
			}
		}
	} else {
		flag = false
	}
	return flag
}
